//
//  CAnAlgAutoDetecActivity+Desc.m
//  CareRing
//
//  Created  on 2024/12/14.
//
    
#import <DateTools/DateTools.h>
#import "CAnAlgAutoDetecActivity+Desc.h"
#import "ConfigModel.h"

@implementation CAnAlgAutoDetecActivity (Desc)


-(NSString *)wholeDesc
{

    NSMutableString *infoString = [NSMutableString new];
    NSDate *date = [NSDate dateWithTimeIntervalSince1970:self.timeStamp];
    [infoString appendFormat:@"Date:%@, ", [date formattedDateWithFormat:_L2(L_DATE_FMT)]];
    [infoString appendFormat:@"UUid:%@, ", self.dataUuid];

    [infoString appendFormat:@"Distance:%.2f Km, Steps:%u, WholeEnergy:%u Kcal, ActivityEnergy:%u Kcal, vo2:%@, vo2Max:%@, ", self.distance, self.steps, self.wholeEnergyCnsmptn, self.activityEnergyCnsmptn, self.vo2, self.vo2Max];
   
    
    [infoString appendFormat:@"Activity Status:%@, Activity Type:%@", [[self class] keepWorkoutDesc:self.keepExeType],  [[self class] activityTypeDesc:self.activityType] ];
    

    return infoString;
    
}

+(NSString *) activityTypeDesc:(CAnAlgAutoDetec_ACTIVITY_TYP)activityType
{
    NSString *str = @"";

    switch (activityType) {
           case         CAnalgAutoDetec_ACTIVITY_NO: // 0-无活动或活动非常轻微
        {
            str = @"No activity";
        }
            break;
        case         CAnalgAutoDetec_ACTIVITY_NO_KIND : // Rhythmic and arrhythmic activities that do not fit into other categories(不能归入其他类别的有节奏和无节奏活动)
        {
            str = @"Cannot be classified";
        }
            break;
        case          CAnalgAutoDetec_ACTIVITY_WALKING : // 正在走路
        {
            str = @"Walking";
        }
            break;
        case         CAnalgAutoDetec_ACTIVITY_RUNNING : // 正在跑步
        {
            str = @"Running";
        }
            break;
        case         CAnalgAutoDetec_ACTIVITY_SWIMING :// 正在游泳
        {
            str = @"Swimming";
        }
            break;
        case          CAnalgAutoDetec_ACTIVITY_OTHER_RHYTHMIC: // Other rhythmic activities(其他有节奏的活动)
        {
            str = @"other";
        }
            break;
            
        default:
            break;
    }
    
    return str;
}

+(NSString *)keepWorkoutDesc:(CAnAlgAutoDetec_Exe_type)keepExeType
{
    NSString *str = @"";
    switch (keepExeType) {
        case     CAnalgAutoDetec_EXE_TYPE_NO_CONTINUE : // No continuous exercise
        {
            str = @"Continuous Activities";
        }
            break;
        case     CAnalgAutoDetec_EXE_TYPE_CONTINUE: // Keep exercising
        {
            str = @"Non-continuous activity";
        }
            break;
        default:
            break;
    }
    return str;
    
}

@end
